package com.stars.easyms.logger.config;

import org.springframework.web.context.ContextCleanupListener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * <p>className: EasyMsLoggerListener</p>
 * <p>description: 用于SpringMvc的启动监听开启异步Logging</p>
 *
 * @author guoguifang
 * @date 2019-12-25 10:32
 * @since 1.5.0
 */
public final class EasyMsLoggerListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent event) {
        EasyMsLoggerInitializer.redefine();
    }

    @Override
    public void contextDestroyed(ServletContextEvent event) {
        new ContextCleanupListener().contextDestroyed(event);
    }

}
